package com.dongdong.api;

import com.dongdong.model.TbOrder;
import com.dongdong.model.TbOrderItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient("dongdong-order-service")
public interface OrderApi {

    @PostMapping("/order/updatePayOrder")
    public void  updatePayOrder(@RequestBody TbOrder order);

    @PostMapping("/order/updatePayOrderItem")
    public void updatePayOrderItem(@RequestBody TbOrderItem item);

    @GetMapping("/order/selectByOutTradeNo")
    TbOrder selectByOutTradeNo(@RequestParam String outTradeNo);

    @GetMapping("/order/selectByItemOutTradeNo")
    TbOrderItem selectByItemOutTradeNo(@RequestParam String outTradeNo);
}
